const rosyModule = {
  namespaced: true,
  state: {
    counter: 0,
    name: "Rosy",
  },
  mutations: {
    increment(state) {
      state.counter++
    },
    decrement(state) {
      state.counter--
    },
  },
  actions: {
    incrementAsyn({ commit }) {
      setTimeout(() => {
        commit("increment")
      }, 1000)
    },
    decrementAsyn({ commit }) {
      setTimeout(() => {
        commit("decrement")
      }, 1000)
    },
  },
  getters: {
    tripleCounter(state) {
      return state.counter * 3
    },
  },
}

export default rosyModule
